<template>
    <div>
        <van-collapse v-model="activeName" accordion>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.qy+'（待审核）'" :name="index"
                v-show="item.type == 1">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.qy+'（待审核）'" :name="index"
                v-show="item.type == 2">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.hwzl+'（待审核）'" :name="index"
                v-show="item.type == 3">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.jbfl+'（待审核）'" :name="index"
                v-show="item.type == 4">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.jbfl+'（待审核）'" :name="index"
                v-show="item.type == 5">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.jbfl+'（待审核）'" :name="index"
                v-show="item.type == 6">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
            <van-collapse-item v-for="(item,index) in list" :key="item.id" :title="item.jbfl+'（待审核）'" :name="index"
                v-show="item.type == 7">
                <van-steps direction="vertical" :active="0">
                    <van-step>
                        <h3>{{item.shjg}}</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                    <van-step>
                        <h3>审核成功 / 审核失败</h3>
                        <p>{{item.shsj}}</p>
                    </van-step>
                </van-steps>
            </van-collapse-item>
        </van-collapse>
        <van-empty description="暂无数据" v-show="value" />
    </div>
</template>

<script>
    export default {
        data() {
            return {
                // sfz: "",
                list: [],
                activeName: '1',
                lists: [],
                value: false,
                qbsj: [],
            }
        },
        created() {
            this.wdsq()
        },
        mounted() {
            var mx = window.sessionStorage.getItem("mz")
            var sjh = window.sessionStorage.getItem("sjh")
            var sfz = window.sessionStorage.getItem("sfz")
            var xb = window.sessionStorage.getItem("xb")
            // this.name = mx
            this.sfz = sfz
            // this.lxdh = sjh
            // this.radio = xb
        },
        methods: {
            wdsq() {
                var sfz = window.sessionStorage.getItem("sfz")
                var that = this
                if (sfz == null || sfz == "") {
                    that.sl = 0
                } else {
                    var jmqsjtj = JSON.stringify({
                        //入参内容
                        sfz: sfz,
                        // sfz: "411122200010288050"
                    })
                    var jmhsjtj = SM.encrypt(jmqsjtj,
                        //公钥
                        "04ccdf633a1fe8216ef9a5f24a30221ccfa017f0da9abcaf5ea56acf7c2d8434ac707b34fa65d08092b4a34e9f60a082cf6240c2e144c8e5e6a9495a3ba4958125"
                    );
                    // var appid = that.appid;
                    var appid = "Embmzckm";
                    var interfaceid = 'zzshlb';
                    var interfacecontent = jmhsjtj
                    var fromport = '2';
                    var signurl = 'https://' + urldomaincreatesign;
                    var gatewayurl = 'https://' + urldomaingateway;
                    vaildInterfacefn(appid, interfaceid, interfacecontent, fromport, signurl, gatewayurl).then(
                        value => {
                            //私钥
                            var jjjsjtj = SM.decrypt(value,
                                "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b");
                            var list = JSON.parse(jjjsjtj)
                            that.list = list.result
                            for (let z = 0; z < that.lists.length; z++) {
                                for (let i = 0; i < that.qbsj.length; i++) {
                                    if (that.lists[z].hwzl == that.qbsj[i].id) {
                                        that.lists[z].hwzl = that.qbsj[i].name
                                    }
                                }
                            }
                            console.log(that.list);
                            if (that.list == 0) {
                                that.value = true
                            }
                            console.log(that.list.length);
                            // that.columns = list.result
                        })
                }
            },
            spzl() {
                var that = this
                var jmqsjtj = JSON.stringify({
                    //入参内容
                })
                var jmhsjtj = SM.encrypt(jmqsjtj,
                    //公钥
                    "04a4bd0de5d7229c1ac5c9d3e50c23e426e9bc6fd1efdc391352203383f79cb73347693f139e4c51942511baa9fdf9731671e214ff49aa4d1b5276a8832b41a68d"
                );
                // var appid = that.appid;
                var appid = "Embmzckm";
                var interfaceid = 'hqhwzllb';
                var interfacecontent = jmhsjtj
                var fromport = '2';
                var signurl = 'https://' + urldomaincreatesign;
                var gatewayurl = 'https://' + urldomaingateway;
                vaildInterfacefn(appid, interfaceid, interfacecontent, fromport, signurl, gatewayurl).then(
                    value => {
                        //私钥
                        var jjjsjtj = SM.decrypt(value,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b");
                        var list = JSON.parse(jjjsjtj)
                        console.log(list.result);
                        that.qbsj = list.result
                        that.wdsq()
                    })
            },
        },
    }
</script>

<style>

</style>